package com.mms.entity.model;

/**
 * Created by dangz on 2017/5/21/021.
 */
public class PagerTool {
    int start = 0 ;
    int end = 10;
    String sortby;
    String sorttype = "desc";
    Integer rows = 10;
    Integer page = null ; // 分页
    public PagerTool(){

    }

    public int getStart() {
        if ( page != null && page > 0){
            return (page-1)*rows;
        }
        return start;
    }
    public void setStart(int start) {
        this.start = start;
    }
    public int getEnd() {
        if ( page != null && page > 0){
            return page*rows;
        }
        return end;
    }
    public void setEnd(int end) {
        this.end = end;
    }

    public String getSortby() {
        return sortby;
    }

    public void setSortby(String sortby) {
        this.sortby = sortby;
    }

    public String getSorttype() {
        return sorttype;
    }

    public void setSorttype(String sorttype) {
        this.sorttype = sorttype;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public PagerTool(int start, int end, String sortby, String sorttype,
                     Integer rows, Integer page) {
        super();
        this.start = start;
        this.end = end;
        this.sortby = sortby;
        this.sorttype = sorttype;
        this.rows = rows;
        this.page = page;
    }
}
